package com.genius.smsdao.attendancemanage.domain;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.genius.smsbase.Domain.BaseEntity;

import javax.persistence.*;
import java.util.List;

/**
 * @Entity:Attendance 考勤方式实体类
 * 对应数据库表名：way
 * @author：liangwei
 */
@Entity
@Table(name = "way")
public class Way extends BaseEntity<Long> {


    @Column
    private String name; 

    //考勤方式到考勤一对多关系
    @JsonIgnoreProperties(value = "way",allowSetters = true)
    @OneToMany(mappedBy = "way",cascade = {CascadeType.REMOVE,CascadeType.REFRESH},fetch = FetchType.EAGER)
    private List<Attendance> attendanceList;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Attendance> getAttendanceList() {
        return attendanceList;
    }

    public void setAttendanceList(List<Attendance> attendanceList) {
        this.attendanceList = attendanceList;
    }

    @Override
    public String toString() {
        return "Way{" +
                "name='" + name + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", id=" + id +
                '}';
    }
}
